package StudyCode.summary.zipfile;

import java.io.IOException;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class DetermineZipEntryIsDirectory {
	public static void main(String args[]) {
		try {
			ZipFile zipFile = new ZipFile("E:/Copy/zipdemo.zip");
			Enumeration e = zipFile.entries();

			System.out.print("文件名");
			System.out.print("\t\t\t\t是不是目录");
			System.out.println();

			while (e.hasMoreElements()) {
				ZipEntry entry = (ZipEntry) e.nextElement();

				String entryName = entry.getName();
				boolean isDir = entry.isDirectory();

				System.out.print(entryName);
				System.out.print("\t\t\t\t" + isDir);
				System.out.print("\n");

			}
			zipFile.close();

		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
	}
}
